using UnityEngine;
using System.Collections;

public class enemy : MonoBehaviour {
	
	public GameObject player;
	private float health = 10;
	private float step = 1.0f;
	
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
		transform.position = Vector3.MoveTowards(transform.position, player.transform.position, step*Time.deltaTime);
	}

	public void takeDamage(float damage) {
		if((health -= damage) <= 0) {
			//If in the future we dont deleate the enemy reset all the stats
			Destroy(transform.gameObject);
		}
	}

}
